<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LIN bus API (LINlib)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="kvaser.gif"/></td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('page_linlib.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">LIN bus API (LINlib) </div>  </div>
</div><!--header-->
<div class="contents">
<div class="toc"><h3>Table of Contents</h3>
<ul><li class="level1"><a href="#section_user_guide_lin_lib_1">Description</a></li>
<li class="level1"><a href="#section_user_guide_lin_intro">Using the LIN Bus</a></li>
<li class="level1"><a href="#section_user_guide_lin_frame_identifiers">LIN Frame Identifiers</a></li>
<li class="level1"><a href="#section_user_guide_lin_where_to_go_from_here">Where to go from here</a></li>
</ul>
</div>
<div class="textblock"><h1><a class="anchor" id="section_user_guide_lin_lib_1"></a>
Description</h1>
<p>The LINlib library is used to interact with the LIN bus. Similar to the <a class="el" href="page_canlib.html">CAN bus API (CANlib)</a>, it holds functions to set bus parameters, go bus on/off and read/write LIN messages.</p>
<h1><a class="anchor" id="section_user_guide_lin_intro"></a>
Using the LIN Bus</h1>
<p>Using the LIN bus requires special hardware, e.g. Kvaser Leaf Professional LIN, Kvaser Hybrid 2xCAN/LIN or Kvaser Hybrid Pro 2xCAN/LIN.</p>
<p>The CAN API calls are not directly suitable for the LIN bus. Instead, a new API is provided that enables you to use the LIN bus as easily as you use the CAN bus. The function calls in the LIN API all have names starting with lin, e.g <a class="el" href="group___l_i_n.html#gaca2d874c870f16c11a4e8e158817d8bf">linReadMessage()</a>.</p>
<p>You will need to </p><div class="fragment"><div class="line"><span class="preprocessor">#include linlib.h</span></div></div><!-- fragment --><p>in your programs, and link with linlib.dll (which, in turn, uses canlib32.dll).<br />
 On Linux, the files are called liblinlib.so and libcanlib.so respectively.</p>
<h1><a class="anchor" id="section_user_guide_lin_frame_identifiers"></a>
LIN Frame Identifiers</h1>
<p>LIN frame identifiers range from ID 0x00 to 0x3F. IDs 0x3E and 0x3F are reserved for future use.</p>
<p>IDs 0x3C and 0x3D are used for diagnostics frames and behave somewhat differently compared to the regular frames.<br />
 0x3C is called the master request frame and 0x3D is called the slave response frame.<br />
 Diagnostic frames should contain eight bytes of data and use the classic checksum (even if <a class="el" href="linlib_8h.html#a937225a25c3c24efabf7c8438ccecd09">LIN_ENHANCED_CHECKSUM</a> is specified).<br />
 0x3D is single shot and its slave message buffer is automatically cleared upon reception of a 0x3C or 0x3D.</p>
<h1><a class="anchor" id="section_user_guide_lin_where_to_go_from_here"></a>
Where to go from here</h1>
<p>For more details, see the module <a class="el" href="group__grp__linlib.html">LINlib</a>. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.13-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer"> (canlib 5.38) Tue Feb 15 2022</li>
  </ul>
</div>
</body>
</html>
